import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'uteped_sdk_platform_interface.dart';

/// An implementation of [UTEPedSdkPlatform] that uses method channels.
class MethodChannelUTEPedSdk extends UTEPedSdkPlatform {
  /// The method channel used to interact with the native platform.
  @visibleForTesting
  final methodChannel = const MethodChannel('uteped_sdk/method');

  @override
  Future<String?> getPlatformVersion() async {
    final version = await methodChannel.invokeMethod<String>('getPlatformVersion');
    return version;
  }

  @override
  Future<bool> bFunc(Map<String, Object> params) async {
    final bValue = await methodChannel.invokeMethod<bool>("bFunc", params);
    return bValue!;
  }

  @override
  Future<String> sFunc(Map<String, Object> params) async {
    final bValue = await methodChannel.invokeMethod<String>("sFunc", params);
    return bValue!;
  }

  @override
  Future<dynamic> dFunc(Map<String, Object> params) async {
    final dValue = await methodChannel.invokeMethod<dynamic>("dFunc", params);
    return dValue!;
  }

  @override
  Future<void> vFunc(Map<String, Object> params) async {
    await methodChannel.invokeMethod<void>("vFunc", params);
  }

  @override
  Future<void> vFunAsync(Map<String, Object> params) async {
    methodChannel.invokeMethod<void>("vFunAsync", params);
  }

}
